SUBROUTINE PARA_S
     * Demonstrate the use of the RW_START_PARA and RW_END_PARA subroutines.

     * Include the RealWeb definitions
     INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP

     * Start the HTML page.
     CALL RW_START_HTML_PAGE("Paragraph Example 2", "", "", "", "")

     * Define some CSS styles.
     STYLES = "#last {" : ...
        "font-family: Braggadocio;" : ...
        "font-size: 14pt;" : ...
        "color: white;" : ...
        "background-color: maroon;" : ...
        "margin-left: 100px;" : ...
        "margin-right: 100px;" : ...
        "border: thick inset crimson;" : ...
        "padding: 10px;" : ...
        "text-align: center;" : ...
        "}"
     STYLES = STYLES : ".special {" : ...
        "font-family: Arial;" : ...
        "font-size: 12pt;" : ...
        "color: green;" : ...
        "text-align: right;" : ...
        "}"
     CALL RWS_STYLE(STYLES, "")
     CALL RW_PUT_EX(STYLES, RWD_HEAD)

     HTML = ""

     * Insert some paragraphs.
     TEXT = "This is the first paragraph, at the very beginning " : ...
        "of the body of the document. "
     TEXT = TEXT : "A call to RWS_PARA formats the text as a paragraph."
     CALL RWS_PARA(TEXT, "", "")
     HTML = HTML : TEXT

     TEXT = "This is the second paragraph. "
     TEXT = TEXT : "When rendered by a browser, it will begin slightly " : ...
        "below the end of the first paragraph, with a bit of extra " : ...
        "white space between the two paragraphs. "
     CALL RWS_PARA(TEXT, "", "")
     HTML = HTML : TEXT

     TEXT = "The next two paragraphs show how you can change the "
     CALL RWA_NEWLINES(TEXT, 1)
     TEXT = TEXT : "appearance of the text with CSS styles. "
     CALL RWA_NEWLINES(TEXT, 1)
     TEXT = TEXT : "This can be done by applying a class..."
     CALL RWS_PARA(TEXT, "", "special")
     HTML = HTML : TEXT

     TEXT = "...or through the paragraph's id. "
     CALL RWS_PARA(TEXT, "last", "")
     HTML = HTML : TEXT

     TEXT = "This is the last paragraph in the example."
     CALL RWS_PARA(TEXT, "", "")
     HTML = HTML : TEXT

     * Output the HTML.
     CALL RW_PUT(HTML)

     * Complete the page.
     CALL RW_END_PAGE
RETURN

Go to top button